﻿using Microsoft.SharePoint;

namespace Centric.SharePoint.Branding.MasterPage.ChildSiteInit {

  public class ChildSiteInit : SPWebEventReceiver 
  {
    public override void WebProvisioned(SPWebEventProperties properties) 
    {
      SPWeb childSite = properties.Web;
      SPWeb topSite = childSite.Site.RootWeb;
      childSite.MasterUrl = topSite.MasterUrl;
      childSite.CustomMasterUrl = topSite.CustomMasterUrl;
      childSite.AlternateCssUrl = topSite.AlternateCssUrl;
      childSite.SiteLogoUrl = topSite.SiteLogoUrl;
      childSite.Update();
    }
  }
}
